const gaugeData11 = (data) => {
  var targetValue = data.targetValue;
  var realValue = data.realValue;
  var dataRuserl = {
    title: "仪表盘",
    name: data.name,
    value: ((100 * realValue) / targetValue).toFixed(2),
    color: {
      pieMini: "#ffca1c", //小圆形颜色
      pieMiniMini: "#fff", //小小圆形颜色
      piePlus: "#5DD1FA", //大圆形颜色
      value: "#B0E0FF", //底部数值颜色
      pieOutSide:data.color, //外圆颜色
    },
  };
  let option = {
    series: [
      {
        name: "刻度1",
        type: "gauge",
        radius: "160%",
        center: ['50%', '75%'],
        min: 0, //最小刻度
        max: 100, //最大刻度
        splitNumber: 5, //刻度数量
        startAngle: 180,
        endAngle: 0,
        axisLine: {
          show: true,
          lineStyle: {
            width: 1,
            color: [[1, "rgba(0,0,0,0)"]],
          },
        }, //仪表盘轴线
        axisLabel: {
          show: false,
          color: "#4d5bd1",
          distance: 5,
          formatter: function (v) {
            switch (v + "") {
              case "0":
                return "0";
              case "10":
                return "10";
              case "20":
                return "20";
              case "30":
                return "30";
              case "40":
                return "40";
              case "50":
                return "50";
              case "60":
                return "60";
              case "70":
                return "70";
              case "80":
                return "80";
              case "90":
                return "90";
              case "100":
                return "100";
            }
          },
        }, //刻度标签。
        axisTick: {
          show: true,
          splitNumber: 2,
          lineStyle: {
            color: "#8a8f92", //用颜色渐变函数不起作用
            width: 1,
          },
          length: 3,
        }, //刻度样式
        splitLine: {
          show: true,
          length: 5,
          lineStyle: {
            color: "#8a8f92", //用颜色渐变函数不起作用
            width: 1,
          },
        }, //分隔线样式
        detail: {
          show: false,
        },
        pointer: {
          show: false,
        },
      },
      {
        name: "仪表盘1",
        type: "gauge",
        radius: "142%",
        center: ['50%', '75%'],
        splitNumber: 10,
        startAngle: 180,
      endAngle: 0,
        axisLine: {
          lineStyle: {
            color: [
              [dataRuserl.value / 100, dataRuserl.color.pieOutSide],
              [1, "#111F42"],
            ],
            width: 2,
          },
        },
        axisLabel: {
          show: false,
        },
        axisTick: {
          show: false,
        },
        splitLine: {
          show: false,
        },
        itemStyle: {
          show: false,
        },
        detail: {
          formatter: function (value) {
            if (value !== 0) {
              var num = Math.round(value);
              return parseInt(num).toFixed(0) + "  %";
            } else {
              return 0;
            }
          },
          offsetCenter: [0, "-40%"],
          textStyle: {
            padding: [0, 0, 80, 0],
            fontSize: 10,
            fontWeight: "700",
            color: dataRuserl.color.pieOutSide || "#83af98",  //百分比数字颜色
          },
        },
        title: {
          color: "#fff",
          fontSize: 9,
          offsetCenter: [0, "-5%"],
        },
        data: [
          {
            name: data.name + "  " + realValue ,  
            value: dataRuserl.value,  //百分比数值
          },
        ],
        pointer: {
          show: false,
          length: "75%",
          width: 20, //指针粗细
        },
      },
    ],
  };
  const opt = Object.assign({},option);
  return opt;
}

export default {
  gaugeData11
}
